package com.hhxy.reflect;
//获取类对象的三种方法
public class ReflectDemo1 {
    public static void main(String[] args) throws ClassNotFoundException {
       //1.Class.forName("全类名")获取class对象
        Class c1 =  Class.forName("com.hhxy.reflect.Person");
        //2.类名.class获取class对象
        Class c2 = Person.class;
        //3.对象名.getClass()获取class对象
        Person p = new Person();
        Class c3 = p.getClass();
        System.out.println(c1==c2 && c1==c3 && c2==c3);//输出true
    }
}
